<template>
	<view class="box" :style="{padding:padding,color:fontColor}">
		<view class="box__title">
			<text> {{props.title}} </text>
			<view class="box__title--time" v-if="showDate">
				<text>23年7月 - 24年6月</text>
				<tn-icon name="down" class="tn-pr-xs"/>
			</view>
		</view>
		<view class="box__conten">
			<slot></slot>
		</view>
	</view>
</template>

<script setup lang="ts">
	const props = defineProps({
		title: {
			type: String,
			default: "图鸟UI"
		},
		showDate:{
			type:Boolean,
			default:false
		},
		padding:{
			type:String,
			default:'50rpx 0;'
		},
		bg:{
			type:String,
			default:'#F8F7F8'
		},
		fontColor:{
			type:String,
			default:'#333'
		}
	})
</script>

<style lang="scss">
	.box{
		padding: 50rpx 0;
		border-bottom: 20rpx solid v-bind(bg);
		&__title{
			padding: 30rpx;
			display: flex;
			align-items: center;
			justify-content: space-between;
			>text{
				font-weight: bold;
				font-size: 32rpx;
			}
			&--time{
				background: #F8F7F8;
				color: #838383;
				font-size: 24rpx;
				padding: 10rpx;
				border-radius: 6rpx;
				>text{
					padding: 0 10rpx;
				}
			}
		}
		&__conten{
			// min-height: 500rpx;
			// max-height: 500rpx;
		}
	}
</style>